Package pptx4j.slide

Source Code of pptx4j.slide.AsposeRemoveSlide

package pptx4j.slide;

import com.aspose.slides.ISlide;
import com.aspose.slides.Presentation;
import com.aspose.slides.SaveFormat;

public class AsposeRemoveSlide
{
  public static void main(String[] args)
  {
        //Instantiate a Presentation object that represents a presentation file
    Presentation pres = new Presentation("data/pptx4j/presentation.pptx");

    //Accessing a slide using its index in the slides collection
    ISlide slide = pres.getSlides().get_Item(1);

    //Removing a slide using its reference
    pres.getSlides().remove(slide);
   
    //Removing a slide using its slide index
    pres.getSlides().removeAt(0);

    //Writing the presentation file
    pres.save("data/pptx4j/RemovedSlide-Aspose.pptx",SaveFormat.Pptx);

        //Printing the status
        System.out.println("Slides removed successfully!");
  }
}
TOP

Related Classes of pptx4j.slide.AsposeRemoveSlide

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.